package com.kordar.admin.kernel.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Constraint(validatedBy = UniqueValidator.class)    //具体的实现
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD})
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Documented
public @interface Unique {
    String message() default "值已存在";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
    Class<? extends DbUniqueExists> classz();
    String classzName() default "";
    String field();
}
